package svc

import (
	"github.com/zeromicro/go-zero/zrpc"
	"gozerogateway/api/internal/config"
	"gozerogateway/rpc/admin/admin"
	"gozerogateway/rpc/svc/service"
)

type ServiceContext struct {
	Config config.Config

	Admin admin.Admin
	Svc   service.Service
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config: c,

		Admin: admin.NewAdmin(zrpc.MustNewClient(c.AdminRpc)),
		Svc:   service.NewService(zrpc.MustNewClient(c.SvcRpc)),
	}
}
